<?php
namespace App\Model\Attend;

use App\Model\Base;


class LeaveAuth extends Base{
    public $tableName = "mymk_leave_auth";


    public function getLeaveLog(string $field = '*', array $where = [], array $order = ['id', 'desc'], $swhere){
        $result = $this
            ->field($field)
            ->order($order[0], $order[1])
            ->where($where)
            ->where($swhere)
            ->all();

        $lists = $this->lastQueryResult()->getResult();

        return $lists;
    }

    /**
     * 获取审批人及信息
     * @auth   xiaozhi
     * @param  array   $condition [description]
     * @return [type]             [description]
     */
    public function getAuthStaff($field = '*', $where = [], $order = ['A.id', 'desc']) {

        $this->withTotalCount()
            ->field($field)
            ->order($order[0], $order[1])
            ->alias('A')
            ->join('mymk_face as B','A.faceid=B.id','LEFT')
            ->where($where)
            ->all();

        $lists = $this->lastQueryResult()->getResult();

        // $list = $lastResult->getResult();
        return $lists;
    }
}